<?php
namespace App\Http\Controllers\Reception;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

use App\admin\Netsetting;
use App\admin\Scrollimg;
use App\admin\Logo;
use App\admin\About;
use App\admin\Newnet;
use App\admin\Technical;
use App\admin\Good;

class IndexController extends Controller
{
	public function __construct() {
//		$this->middleware('admindo');
	}
	
	public function index()
	{
		//取网站设置
		$net = new Netsetting;
		$Netsettings = $net::find(1);
		//取滚动图片
		$scrolls = Scrollimg::get();
		//几个LOGO
		$Logos = Logo::get();
		//公司简介
		$about = new About;
		$compy = $about::find(4);
		//公司动态
		$new = new Newnet;
		$news1 = $new::where('type', 0)->limit(5)->get();
		$news2 = $new::where('type', 1)->limit(5)->get();
		$news3 = $new::where('type', 2)->limit(5)->get();
		
		//技术支持
		$TechnicalModel = new Technical;
		$Technical = $TechnicalModel::where('state', 0)->limit(5)->get();
		//产品中心
		$Good = new Good;
		$Goods = $Good::where('state', 0)->limit(5)->get();
		
		return view('reception.index',['news1'=>$news1,'news2'=>$news2,'news3'=>$news3,
		'setData'=>$Netsettings,'scrollData'=>$scrolls,'logo'=>$Logos,'compy'=>$compy,
		'Technical'=>$Technical,'goods'=>$Goods]);
		
	}
	
	private function getSetting(){
		$flight = $net::find(1);
	}
	
}
